package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Security(value="C")
@LagouController
@LagouRequestMapping("/demo")
public class DemoController {

    @LagouAutowired
    private IDemoService demoService;

    @Security(value={"A","B"})
    @LagouRequestMapping(value="/query")
    public String query(HttpServletRequest request, HttpServletResponse response,String username) {
        return demoService.query(username);
    }

    @Security(value={"D"})
    @LagouRequestMapping(value="/test")
    public String test(HttpServletRequest request, HttpServletResponse response,String username) {
        return demoService.test(username);
    }
}
